package com.gklyj.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gklyj.mapper.userMapper;
import com.gklyj.pojo.User;
import com.gklyj.pojo.Zhanghao;
import com.gklyj.service.userService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional //实现事务的时候要在业务类中加入该注解
public class userServiceImpl extends ServiceImpl<userMapper, User> implements userService {

    @Autowired
    private userMapper userMapper;

    @Override
    public Integer findU_id(String name, String phone_number) {
        return userMapper.findIdByName_Phone(name,phone_number);
    }

    @Override
    public String findNameByUsername(String username) {
        return userMapper.findNameByUsername(username);
    }

    @Override
    public String findDepartmentByUsername(String username) {
        return userMapper.findDepartmentByUsername(username);
    }

    @Override
    public List<User> findUserByRole(String role) {
        return userMapper.findUserByRole(role);
    }

    @Override
    public List<User> searchQzUser(User user) {
        return userMapper.searchQzUser(user);
    }

    @Override
    public User findUserById(Integer u_id) {
        return userMapper.findUserById(u_id);
    }

    @Override
    public List<User> searchZpUser(User user) {
        return userMapper.searchZpUser(user);
    }

    @Override
    public User findUserByUsername(String username) {
        return userMapper.findUserByUsername(username);
    }

    @Override
    public Integer getQzNumberByGrades(String grade) {
        return userMapper.getQzNumberByGrade(grade);
    }

    @Override
    public Integer GetQiuzhiNumber() {
        return userMapper.getQiuzhiNumber();
    }

    @Override
    public Integer GetZhaopingNumber() {
        return userMapper.getZhaopingNumber();
    }


}
